<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <title>webrx</title>
</head>
<body>
<h1 id="st"></h1>

<h2>fetch get 获取数据库列表</h2>
<div id="dbs">

</div>
<script>
    fetch('fdb.php?id=100&name=张三丰', {method: 'GET', headers: {'token': '13014577033'}}).then(res => res.text()).then(res => {
        console.log(res)
    })

    function ss() {
        fetch('fget.php').then(res => res.text()).then(rs => {
            //console.log(rs)
            document.querySelector('#st').innerHTML = rs
        })
    }

    //setInterval(ss, 1000) //1秒执行一次

    function dbs() {
        fetch('fgetdbs.php').then(res => res.json()).then(rs => {
            document.querySelector('#dbs').innerHTML = ''
            for (const obj of rs) {
                //console.log(obj.Database)
                document.querySelector('#dbs').innerHTML += `<p>${obj.Database}</p>`;
            }
        })
    }

    //setInterval(dbs, 10) //10毫秒执行一次
</script>
</body>
</html>